import { defineStore } from 'pinia'
export const useStore = defineStore('userInfo', {
  state: () => {
    return {
      LoginInfo: {},
      navMenu: {},
      collapseIcon: false,
      menuTabs: ['首页'],
      activeIndexTab: '首页'
    }
  },
  getters: {

  },
  actions: {
  },

  persist: {
    enabled: true,
    // 设置pinia存储方式
    strategies: [
      {
        key: "userInfo",
        storage: localStorage,
        paths: ['LoginInfo']
      },
      {
        key: "navMenu",
        storage: sessionStorage,
        paths: ['navMenu', 'collapseIcon', 'menuTabs', 'activeIndexTab']
      }
    ]
  }
})